package com.ch.home.bean;

/**
 * 用户信息
 * Created by CHEN on 2019/8/13.
 * OK
 */
public class User {
    private Long userId;//用户id
    private String username;//用户名/账户名
    private String password;//密码
    private Integer age;//年龄
    private Integer gender;//1-male，0-female
    private String phone;//手机号码/可用于短信登录
    private String QQ;//QQ号码，第三方绑定，理应加上微信
    private String email;//邮箱
    private String portrait;//头像url
    private Integer authority;//用户角色：登录用户/游客/管理员
    private Integer status;//用户状态：注销/离线/在线
    private Long integral;//账户金币，可通过
    private int collectNum;//收藏数量

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass( ) != o.getClass( )) return false;

        User user = (User) o;

        if (collectNum != user.collectNum) return false;
        if (userId != null ? !userId.equals(user.userId) : user.userId != null) return false;
        if (username != null ? !username.equals(user.username) : user.username != null) return false;
        if (password != null ? !password.equals(user.password) : user.password != null) return false;
        if (age != null ? !age.equals(user.age) : user.age != null) return false;
        if (gender != null ? !gender.equals(user.gender) : user.gender != null) return false;
        if (phone != null ? !phone.equals(user.phone) : user.phone != null) return false;
        if (QQ != null ? !QQ.equals(user.QQ) : user.QQ != null) return false;
        if (email != null ? !email.equals(user.email) : user.email != null) return false;
        if (portrait != null ? !portrait.equals(user.portrait) : user.portrait != null) return false;
        if (authority != null ? !authority.equals(user.authority) : user.authority != null) return false;
        if (status != null ? !status.equals(user.status) : user.status != null) return false;
        return integral != null ? integral.equals(user.integral) : user.integral == null;
    }

    @Override
    public int hashCode() {
        int result = userId != null ? userId.hashCode( ) : 0;
        result = 31 * result + (username != null ? username.hashCode( ) : 0);
        result = 31 * result + (password != null ? password.hashCode( ) : 0);
        result = 31 * result + (age != null ? age.hashCode( ) : 0);
        result = 31 * result + (gender != null ? gender.hashCode( ) : 0);
        result = 31 * result + (phone != null ? phone.hashCode( ) : 0);
        result = 31 * result + (QQ != null ? QQ.hashCode( ) : 0);
        result = 31 * result + (email != null ? email.hashCode( ) : 0);
        result = 31 * result + (portrait != null ? portrait.hashCode( ) : 0);
        result = 31 * result + (authority != null ? authority.hashCode( ) : 0);
        result = 31 * result + (status != null ? status.hashCode( ) : 0);
        result = 31 * result + (integral != null ? integral.hashCode( ) : 0);
        result = 31 * result + collectNum;
        return result;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", age=" + age +
                ", gender=" + gender +
                ", phone='" + phone + '\'' +
                ", QQ='" + QQ + '\'' +
                ", email='" + email + '\'' +
                ", portrait='" + portrait + '\'' +
                ", authority=" + authority +
                ", status=" + status +
                ", integral=" + integral +
                ", collectNum=" + collectNum +
                '}';
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getQQ() {
        return QQ;
    }

    public void setQQ(String QQ) {
        this.QQ = QQ;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPortrait() {
        return portrait;
    }

    public void setPortrait(String portrait) {
        this.portrait = portrait;
    }

    public Integer getAuthority() {
        return authority;
    }

    public void setAuthority(Integer authority) {
        this.authority = authority;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getIntegral() {
        return integral;
    }

    public void setIntegral(Long integral) {
        this.integral = integral;
    }

    public int getCollectNum() {
        return collectNum;
    }

    public void setCollectNum(int collectNum) {
        this.collectNum = collectNum;
    }

    public User(Long userId, String username, String password, Integer age, Integer gender, String phone, String QQ, String email, String portrait, Integer authority, Integer status, Long integral, int collectNum) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.age = age;
        this.gender = gender;
        this.phone = phone;
        this.QQ = QQ;
        this.email = email;
        this.portrait = portrait;
        this.authority = authority;
        this.status = status;
        this.integral = integral;
        this.collectNum = collectNum;
    }

    public User() {

    }

    public User(Long userId, String username, String password, Integer age, Integer gender, String phone, String QQ, String email, String portrait, Integer authority, Integer status, Long integral, int fansNum, int followNum) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.age = age;
        this.gender = gender;
        this.phone = phone;
        this.QQ = QQ;
        this.email = email;
        this.portrait = portrait;
        this.authority = authority;
        this.status = status;
        this.integral = integral;
    }


    public User(Long userId, String username, String password, String phone, String QQ, String email) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.phone = phone;
        this.QQ = QQ;
        this.email = email;
    }

    public User(String username, String password, String phone, String QQ ) {
        this.username = username;
        this.password = password;this.phone = phone;
        this.QQ = QQ;

    }



}


